using System;
using Avalonia.Media;
using AvaloniaUI.Modal.Animations;

namespace AvaloniaUI.Modal.Services
{
    /// <summary>
    /// 模态对话框选项，用于配置模态对话框的行为
    /// </summary>
    public class ModalDialogOptions
    {
        /// <summary>
        /// 获取或设置一个值，该值指示是否在点击遮罩层时关闭对话框
        /// </summary>
        public bool CloseOnClickOverlay { get; set; } = true;

        /// <summary>
        /// 获取或设置一个值，该值指示是否在按下Esc键时关闭对话框
        /// </summary>
        public bool CloseOnEscape { get; set; } = true;

        /// <summary>
        /// 获取或设置动画设置
        /// </summary>
        public ModalAnimation Animation { get; set; } = ModalAnimation.Default;

        /// <summary>
        /// 获取或设置遮罩层的画刷
        /// </summary>
        public IBrush? OverlayBrush { get; set; }

        /// <summary>
        /// 创建默认选项的副本
        /// </summary>
        /// <returns>新的选项实例</returns>
        public static ModalDialogOptions Default() => new ModalDialogOptions();

        /// <summary>
        /// 创建当前选项的副本
        /// </summary>
        /// <returns>新的选项实例</returns>
        public ModalDialogOptions Clone()
        {
            return new ModalDialogOptions
            {
                CloseOnClickOverlay = this.CloseOnClickOverlay,
                CloseOnEscape = this.CloseOnEscape,
                Animation = this.Animation,
                OverlayBrush = this.OverlayBrush
            };
        }
    }
}